#include "v3d_renderer.h"
#include <v3d_defs.h>

#include "gl_renderer.h"

v3d_renderer_type v3d_renderer::renderer_type = RENDERER_GL;
v3d_renderer *v3d_renderer::I = NULL;

v3d_renderer::v3d_renderer(void)
{
	LOG("hello v3d_renderer ......\n");
}

v3d_renderer::~v3d_renderer(void)
{

}

void v3d_renderer::MessageImmediate(int message_id, void *param)
{
	LOG("msgID %d\n", message_id);

	switch(message_id)
	{
	case MSG_V3D_OBJECT:
		v3d = (v3d_object *)param;
		break;
	case MSG_V3D_INTERFACE_OBJECT:
		v3dInterface = (v3d_object *)param;
		break;
	}
}
void v3d_renderer::Update(int message_id, void *param)
{

}


void v3d_renderer::Init()
{
	LOG("v3d_renderer init called ... \n");
	if(renderer_type == RENDERER_GL)
	{
		I = new gl_renderer();
		I->InitRenderer();
	}

}

void v3d_renderer::DeInit()
{
	if(I != NULL)
	{
		LOG("Destroying v3d_renderer...\n");
		delete I;
		I = NULL;

	}
}
